package com.etpjava.service.impl;

import java.util.Date;
import java.util.List;

import com.etpjava.dao.DepartmentDao;
import com.etpjava.dao.impl.DepartmentDaoImpl;
import com.etpjava.model.Department;
import com.etpjava.service.DepartmentService;

public class DepartmentServiceImpl implements DepartmentService {
	private DepartmentDao dpd=new DepartmentDaoImpl();
	@Override
	public boolean delDep(int id) {
		
		return dpd.delete(selectById(id));
	}

	@Override
	public boolean saveDep(Department dp) {
	
			return dpd.save(dp);
		
	}

	@Override
	public boolean updDep(Department dp) {
	
			return dpd.updata(dp);
		
	}

	
	@Override
	public List<Department> selectByCreateTime(Date time) {
		
		return dpd.selectByCreateTime(time);
	}

	@Override
	public Department selectById(int id) {
		
		return dpd.selectById(id);
	}

	@Override
	public List<Department> selectByName(String name) {
		
		return dpd.selectByName(name);
	}

	@Override
	public List<Department> selectAll() {
		
		return dpd.selectAll();
	}

}
